import java.util.Scanner;

public class Demo2 {
    private  static int n=0;
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
            while (n==0){
                //啥都不写
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("t1循环结束");
        });

        Thread t2=new Thread(()->{
            Scanner scanner=new Scanner(System.in);
            System.out.println("请输入一个整数:");
            n=scanner.nextInt();


        });
        t1.start();
        t2.start();
    }
}
